/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.service.impl;

import model.dao.ActaElectoralDao;
import model.service.ActaElectoralService;
import model.bean.ActaElectoral;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Archivo ActaElectoralServiceImpl.java
 * @Fecha                @Autor   @Cambios
 * 21/01/2011 03:34:32 PM       moshiro
 */
@Service
public class ActaElectoralServiceImpl implements ActaElectoralService {

    @Autowired
    private ActaElectoralDao actaElectoralDao;

    @Override
    public Long agregarActaElectoral(ActaElectoral actaElectoral) throws Exception {
        return actaElectoralDao.agregarActaElectoral(actaElectoral);
    }

    @Override
    public Integer modificarActaElectoral(ActaElectoral actaElectoral) throws Exception {
        return actaElectoralDao.modificarActaElectoral(actaElectoral);
    }

    @Override
    public Integer eliminarActaElectoral(Long codigo) throws Exception {
        return actaElectoralDao.eliminarActaElectoral(codigo);
    }

    @Override
    public List<ActaElectoral> listarActaElectoral(ActaElectoral actaElectoral) throws Exception {
        return actaElectoralDao.listarActaElectoral(actaElectoral);
    }

    @Override
    public ActaElectoral obtenerActaElectoral(ActaElectoral actaElectoral) throws Exception {
        List<ActaElectoral> listado = actaElectoralDao.listarActaElectoral(actaElectoral);
        return !listado.isEmpty() ? listado.get(0) : null;
    }
}
